# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Rasmus Thomsen <oss@cogitri.dev>
pkgname=dconf
pkgver=0.36.0
pkgrel=0
pkgdesc="A low-level configuration system."
url="https://wiki.gnome.org/Projects/dconf"
arch="all"
license="LGPL-2.1-or-later"
makedepends="glib-dev dbus-dev docbook-xsl vala gtk+3.0-dev libxml2-dev meson
	py3-setuptools bash-completion"
checkdepends="dbus"
subpackages="$pkgname-dev $pkgname-doc $pkgname-bash-completion:bashcomp:noarch"
source="https://download.gnome.org/sources/dconf/${pkgver%.*}/dconf-$pkgver.tar.xz"

build() {
	meson \
		--prefix=/usr \
		--localstatedir=/var \
		--buildtype=plain \
		. output
	ninja -C output
}

check() {
	meson test -C output -t 100
}

package() {
	DESTDIR="$pkgdir" ninja -C output install
}

bashcomp() {
	pkgdesc="Bash completions for $pkgname"
	install_if="$pkgname-$pkgver-r$pkgrel bash-completion"

	mkdir -p "$subpkgdir"/usr/share
	mv "$pkgdir"/usr/share/bash-completion "$subpkgdir"/usr/share
}

sha512sums="fed0b4ac13dfeff3bbe428a5c25408a0f13610219e561841a3af75cf18f9c630c385989b700c081b79ab53c00bdecf43c7c94979312c047faefbda4b2653d40d  dconf-0.36.0.tar.xz"
